/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.validator;

import com.minierp.model.EstablishmentLevel;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

public class EstablishmentLevelValidator implements Validator {
	public boolean supports(Class clazz) {
		return EstablishmentLevel.class.isAssignableFrom(clazz);
	}

	public void validate(Object obj, Errors errors) {
		EstablishmentLevel form = (EstablishmentLevel) obj;
		if (form.getLevelName() == null
				|| form.getLevelName().trim().equals("")) {
			errors.rejectValue("levelName", "", "请输入『名称』");
		}

	}
}